import request from '@/utils/request'

//* *********** 配置 **************
// 获取所有数据库配置
export function _configurationLoadAll(data) {
  return request({
    url: '/api/sys/getdataconfigbyall',
    method: 'post',
    data
  })
}

// 按组(groupname)获取组数据库配置
export function _configurationLoad(data) {
  return request({
    url: '/api/sys/getdatagroupnameconfig',
    method: 'post',
    data
  })
}

// 按组(baseid)获取组数据库配置
export function _getdatabaseidconfig(data) {
  return request({
    url: '/api/sys/getdatabaseidconfig',
    method: 'post',
    data
  })
}

// 查看配置数据单条数据 - 单条配置数据详情
export function _configurationDataview(data) {
  return request({
    url: '/api/configuration/dataview?pagevalue=93',
    method: 'post',
    data
  })
}

// 添加配置数据
export function _configurationAdd(data) {
  return request({
    url: '/api/configuration/add',
    method: 'post',
    data
  })
}

// 删除配置数据
export function _configurationDel(data) {
  return request({
    url: '/api/configuration/del',
    method: 'post',
    data
  })
}

// 更新配置数据
export function _configurationUp(data) {
  return request({
    url: '/api/configuration/up',
    method: 'post',
    data
  })
}

//* *********** 附件记录 **************
// 获取附件记录数据列表
export function _attachmenLoad(data) {
  return request({
    url: '/api/attachment/load',
    method: 'post',
    data
  })
}

// 查看附件记录单条数据
export function _attachmentDataview(data) {
  return request({
    url: '/api/attachment/dataview',
    method: 'post',
    data
  })
}

// 添加附件记录并返回id
export function _attachmentAddtoid(data) {
  return request({
    url: '/api/attachment/addtoid',
    method: 'post',
    data
  })
}

// 添加附件记录并返回路径
export function _attachmentAddtoPath(data) {
  return request({
    url: '/api/attachment/addtoPath',
    method: 'post',
    data,
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

// 添加图片并返回id
export function _attachmentAddimg(data) {
  return request({
    url: '/api/attachment/addimg',
    method: 'post',
    data,
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

// 删除附件记录
export function _attachmentDel(data) {
  return request({
    url: '/api/attachment/del',
    method: 'post',
    data
  })
}

// 更新附件记录
export function _attachmentUp(data) {
  return request({
    url: '/api/attachment/up',
    method: 'post',
    data
  })
}

// 阿里云呼叫中台 接口配置 - 列表
export function aliccc_allin(data) {
  return request({
    url: `/api/aliccc/allin?pagevalue=${data.pagevalue}`,
    method: 'post',
    data
  })
}